﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ProjectMaster.master" AutoEventWireup="true"
    CodeBehind="editDuan.aspx.cs" Inherits="Giaiphongmatbang.editDuan" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Style/duan.css" rel="stylesheet" type="text/css" />
    <link href="Style/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="Scripts/jValidateInput.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showdialog() {
            $('.dialogForm').dialog({
                modal: true,
                autoOpen: false,
                width: 470,
                close: function () {
                    allFields.val("").removeClass("ui-state-error");
                }
            });
            $(".dialogForm").parent().appendTo($("form:first"))
            $('.dialogForm').dialog('open');
            return false;
        }

        $(document).ready(function () {
            $('.dialogForm').dialog({
                modal: true,
                autoOpen: false,
                width: 470,
                close: function () {
                    allFields.val("").removeClass("ui-state-error");
                }
            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="table">
        <fieldset class="box-content">
            <legend>Cập nhật thông tin dự án</legend>
            <p>
                <span>Tên dự án:</span>
                <asp:TextBox ID="txtProjectName" runat="server" CssClass="field" Width="450px"/>
            </p>
            <p>
                <span>Ban quản lý dự án</span>
                <asp:TextBox ID="txtInvestor" runat="server" CssClass="field" Width="450px" />
            </p>
            <p>
                <span>Kinh phí dự án</span>
                <asp:TextBox ID="txtCosts" runat="server" CssClass="field" onkeypress="return ValidateKeypress(event);"/>%
            </p>
            <p>
                <span>Cho phép xem dự án</span>
                <asp:CheckBox ID="chkPublic" runat="server" />
            </p>
            <p>
                <span>Dự án đã hoàn thành:</span>
                <asp:CheckBox ID="chkCompleted" runat="server" />
            </p>
            <div class="box-title clearfix">
                Danh sách ban quản lý dự án
                <div class="nr" style="padding-top:3px">
                    <asp:ImageButton ID="btnInsert" runat="server" ImageUrl="~/Images/add-button.jpg"
                        OnClick="btnInsert_Click" ValidationGroup="1" />
                </div>
                <asp:HiddenField ID="hdfModeNew" runat="server" Value="false" />
            </div>
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <th width="50px">
                        TT
                    </th>
                    <th width="180px">
                        Họ và tên
                    </th>
                    <th width="200px">
                        Chức vụ
                    </th>
                    <th width="200px">
                        Đại diện
                    </th>
                    <th>
                        Chức năng
                    </th>
                </tr>
                <asp:Repeater ID="rptInvestor" runat="server" OnItemCommand="rptInvestor_ItemCommand">
                    <ItemTemplate>
                        <tr>
                            <td>
                                <%#Container.ItemIndex + 1 %>
                            </td>
                            <td>
                                <%#Eval("FullName") %>
                            </td>
                            <td>
                                <%#Eval("Order") %>
                            </td>
                            <td>
                                <%#Eval("Representative") %>
                            </td>
                            <td>
                                <asp:ImageButton runat="server" ImageUrl="~/Images/pen.png" CommandArgument='<%#Eval("ManagementID")%>'
                                    CommandName="btnEdit" ValidationGroup="1" />
                                &nbsp;&nbsp;&nbsp;
                                <asp:ImageButton runat="server" ImageUrl="~/Images/delete.png" ValidationGroup="1"
                                    CommandArgument='<%#Eval("ManagementID")%>' CommandName="btnDelete" OnClientClick="return confirm('Xác nhận hành động xóa?');" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div class="box-title" style="text-align:center">
                <asp:Button ID="btnOK" runat="server" Text="Đồng ý" CssClass="button" 
                    onclick="btnOK_Click" ValidationGroup="1" OnClientClick="return confirm('Xác nhận hành động?');" />
                &nbsp;
                <asp:Button ID="Cancel" runat="server" Text="Trở về" CssClass="button" 
                    onclick="Cancel_Click" OnClientClick="window.location='/duan.aspx';" ValidationGroup="1"/>
            </div>
        </fieldset>
    </div>
    <div class="dialogForm box-content" title="Cập nhật thông tin" style="display: none;
        width: 400px;">
        <p>
            <span>Họ tên:</span>
            <asp:TextBox ID="txtFullName" runat="server" CssClass="field" Width="260px" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="(*)"
                ControlToValidate="txtFullName"></asp:RequiredFieldValidator>
        </p>
        <p>
            <span>Chức vụ</span>
            <asp:TextBox ID="txtOrder" runat="server" CssClass="field" Width="260px" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="(*)"
                ControlToValidate="txtOrder"></asp:RequiredFieldValidator>
        </p>
        <p>
            <span>Đại diện</span>
            <asp:TextBox ID="txtRepresentative" runat="server" CssClass="field" Width="260px" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="(*)"
                ControlToValidate="txtRepresentative"></asp:RequiredFieldValidator>
        </p>
        <p>
            <span>
                <asp:Button ID="btnUpdate" runat="server" Text="OK" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                    OnClick="btnUpdate_Click" />
            </span><span>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" ValidationGroup="1" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
            </span>
        </p>
    </div>
</asp:Content>
